{% extends 'machine/base.html' %}

{% block title %} 登录 {% endblock %}

{% block body_block %}

     <div style="margin: 15% 40%;">
        <h1>欢迎登录！</h1>
       <form action="/login/" method="post">
	{% if message %}
	     <div class="ui message ">{{message}}</div>
	{% endif %}
	{% csrf_token %}
	<div class="field">
                <label for="id_username">用户名：</label>
		<div class="ui left icon input">
			<i class="user icon"></i>
                	<input type="text" id="id_username" name="username" placeholder="Username" autofocus required />
		</div>
        </div>
          
            <div class="field">
                <label for="id_password">密码：</label>
		<div class="ui left icon input">
			<i class="lock icon"></i>
                	<input type="password" id="id_password" placeholder="Password" name="password" required >
		</div>
            </div>
	    <div class="field">
		 {{ login_form.captcha.errors }}
                  {{ login_form.captcha.label_tag }}
                  {{ login_form.captcha }}
	    </div>
	    <br>
	    <br>
	    <div class="center aligned">
	    		<button onclick="parent.location.href='/register'" class="ui primary button">注册</button>
	    		<br>
			<button type="reset" class="ui positive button">重置</button>
			<br>
			<button type="submit" class="ui negative button">提交</button>
			<br>
     	    </div>
        </form>
    </div>

{% endblock %}
